#@adminLayout() #define main()
<link href="#(ctx)/static/ajax/libs/bootstrap-fileinput/fileinput.min.css?v=5.2.4" rel="stylesheet"/>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>多文件上传</h5>
                    </div>
                    <div class="ibox-content">
                        <div class="form-group">
                            <label class="font-noraml">多文件上传</label>
	                        <div class="file-loading">
					            <input id="multipleFile" name="files" type="file" multiple>
					        </div>
                        </div>
                        
                    </div>
                </div>
            </div>
        </div>
    </div>

<script src="#(ctx)/static/ajax/libs/bootstrap-fileinput/fileinput.min.js?v=5.2.4"></script>
	<script type="text/javascript">
	var m_id="#(m_id)";
	var cdoc_type="#(cdoc_type)";
	var prefix="#(ctx)/sysfile";
	$(document).ready(function () {
        // 多图上传
        $("#multipleFile").fileinput({
            uploadUrl: prefix + '/uploadMulti',
            uploadAsync: false,
            uploadExtraData : function() {// 向后台传递参数
    			var data = {
    				m_id : m_id,
    				cdoc_type : cdoc_type
    			};
    			return data;
    		}
        }).on('filebatchuploadsuccess', function (event, data, previewId, index) {
        	var rsp = data.response;
        	log.info("return urls：" + rsp.urls)
            log.info("reutrn fileNames：" + rsp.fileNames)
            
            if(window.parent.refresh)
            {
                window.parent.refresh();
            }
        }).on('fileremoved', function (event, id, index) {
            $("input[name='" + event.currentTarget.id + "']").val('')
        }).on('fileerror',function(event,data){
        	$.modal.alertError("上传失败");
    	})
    });
	</script>
</body>
#end
